<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:itdep="http://itdep.bsuir.by/jsf" xmlns:c="http://java.sun.com/jstl/core"
		>

	<ui:decorate template="/facelets/template/mainTemplate.xhtml">
		<f:loadBundle basename="bundle.department" var="departmentBundle"/>
		<ui:param name="title" value="Plans List"/>
		<ui:define name="center">
			<ui:decorate template="/facelets/template/centerTemplate.xhtml">
				<ui:define name="content">
					<f:loadBundle basename="bundle.plan" var="plansBundle"/>

					<h:panelGrid styleClass="centerHeader">
						<h:outputText value="#{studentBundle.markSheet}"/>
					</h:panelGrid>


					<ui:decorate template="/facelets/template/scrollableTableTemplate.xhtml">
						<ui:param name="title" value="Plans List"/>
						<ui:param name="actionBean" value="#{markSheetBean}"/>
						<ui:param name="idPrefix" value="plansDic"/>
						<ui:param name="showAddLink" value="true"/>
						<ui:define name="editPanelContext">


							<h:panelGrid id="markSheetPanel">
								<h:panelGrid columns="2">
									<h:outputText value="#{departmentBundle.faculty}"/>
									<itdep:entitySelectMenu value="#{planBean.filter.faculty}"
															entityType="faculty" format="{i18n.fullName}"
															anyvalue="true"
															required="true" style="width:150px">
										<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
									</itdep:entitySelectMenu>
									<h:outputText value="#{planBundle.speciality}"/>
									<itdep:entitySelectMenu value="#{contentPlanBean.filter.plan}"
															entityType="plan" format="{speciality.i18n.fullName} {year}"
															anyvalue="true"
															filter="#{planBean.filter}"
															required="true" style="width:150px">
										<a4j:support event="onchange" action="#{markSheetBean.filterGroup}"
													 reRender="markSheetPanel" ajaxSingle="true"/>
									</itdep:entitySelectMenu>
									<h:outputText value="#{departmentBundle.studentGroup}"/>
									<itdep:entitySelectMenu value="#{markSheetBean.studFilter.studentGroup}"
															entityType="student-group" format="{i18n.description}"
															anyvalue="true"
															filter="#{studentGroupBean.filter}"
															required="true" style="width:150px">
										<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
									</itdep:entitySelectMenu>
									<h:outputText value="#{planBundle.semester}"/>
									<itdep:entitySelectMenu value="#{formOfControlSemesterBean.filter.semesterPlan}"
															entityType="semester-plan"
															filter="#{semesterPlanBean.filter}" anyvalue="true"
															format="{term}"
															required="true" style="width:150px">
										<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
									</itdep:entitySelectMenu>
									<h:outputText value="#{studentBundle.finishDate}"/>

									<rich:calendar value="#{markSheetBean.record.dateFinish}" inputSize="14"/>


									<h:outputText value="#{planBundle.subject}"/>
									<itdep:entitySelectMenu value="#{semesterPlanBean.filter.contentPlan}"
															entityType="content-plan" filter="#{contentPlanBean.filter}"
															format="{subject.i18n.fullName}"
															required="true" style="width:150px">
										<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
									</itdep:entitySelectMenu>
									<h:outputText value="#{studentBundle.numberSheet}"/>
									<h:inputText value="#{markSheetBean.record.numberSheet}"/>
									<h:outputText value="#{planBundle.formOfControl}"/>
									<itdep:entitySelectMenu value="#{markSheetBean.record.formOfControlSemester}"
															entityType="form-of-control-semester"
															filter="#{formOfControlSemesterBean.filter}"
															format="{formOfControl.i18n.fullName}"
															required="true" style="width:150px">
										<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
									</itdep:entitySelectMenu>
									<h:outputText value="#{personBundle.employee}"/>
									<itdep:entitySelectMenu value="#{markSheetBean.record.employee}"
															entityType="employee" filter="#{employeeBean.filter}"
															format="{firstName} {lastName}"
															required="true" style="width:150px">
										<a4j:support event="onchange" reRender="markSheetPanel" ajaxSingle="true"/>
									</itdep:entitySelectMenu>

									<h:outputText value="#{studentBundle.passDate}"/>

									<rich:calendar value="#{markSheetBean.record.datePass}" inputSize="14"/>
								</h:panelGrid>
							</h:panelGrid>

						</ui:define>

						<ui:define name="tableContext">
							<rich:column width="1%">
								<f:facet name="header">
									<h:outputText value="#{plansBundle.number}"/>
								</f:facet>
								<h:outputText value="#{record.id}"/>
							</rich:column>
							<rich:column width="31%">
								<f:facet name="header">
									<h:outputText value="#{plansBundle.subject}"/>
								</f:facet>

								<itdep:entityOutput
										value="#{record.formOfControlSemester.semesterPlan.contentPlan.subject}"
										format="{i18n.fullName}"
										locale="#{subjectDicBean.translationBean.locale}"/>

							</rich:column>
							<rich:column width="21%">
								<f:facet name="header">
									<h:outputText value="#{studentBundle.numberSheet}"/>
								</f:facet>
								<h:outputText value="#{record.numberSheet}"/>
							</rich:column>
							<rich:column width="21%">
								<f:facet name="header">
									<h:outputText value="#{studentBundle.createDate}"/>
								</f:facet>
								<h:outputText value="#{record.dateCreate}"/>
							</rich:column>
							<rich:column width="21%">
								<f:facet name="header">
									<h:outputText value="#{studentBundle.finishDate}"/>
								</f:facet>
								<h:outputText value="#{record.dateFinish}"/>
							</rich:column>
							<rich:column width="21%">
								<f:facet name="header">
									<h:outputText value="#{studentBundle.passDate}"/>
								</f:facet>
								<h:outputText value="#{record.datePass}"/>
							</rich:column>

						</ui:define>

					</ui:decorate>
				</ui:define>
			</ui:decorate>
		</ui:define>
	</ui:decorate>
</f:view>